package com.hopes.bizz.basic.hazard.sds.vo;

import com.hopes.bizz.basic.common.constant.enums.ParkBasicModDictEnum;
import com.hopes.bizz.basic.hazard.sds.entity.HazChemicalSdsEntity;
import com.hopes.bizz.common.core.util.DateUtils;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.admin.api.resolver.enums.SysDictEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author daijie
 * @version 1.0
 * @date 2023/11/14 10:44
 * @Description:
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class HazChemicalStockPageVO extends HazChemicalSdsEntity {
    private static final long serialVersionUID = -3907729670476280094L;

    private Long sdsId;

    private Boolean keyFlag;

    private String casNo;

    private BigDecimal stockNum;

    private Date dataTime;

    private BigDecimal inNum;

    private BigDecimal outNum;

    public String getSdsIdStr() {
        return DictResolver.getItemLabelByValue(ParkBasicModDictEnum.chemical_sds, this.sdsId);
    }

    public String getDataTimeStr() {
        return DateUtils.limitDay(this.dataTime);
    }

    public String getKeyFlagStr() {
        return DictResolver.getItemLabelByValue(SysDictEnum.yes_no_type, this.keyFlag);
    }

}
